From: Po Lu Date: Mon, 28 Feb 2022 01:40:01 +0000 (+0800) Subject: Don't save menu bar events that land on the menu bar itself X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~16^2~2527 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=0f3ce51a0d5f2aabad3d3aeb3d86d52b152deef0;p=emacs.git Don't save menu bar events that land on the menu bar itself * src/xterm.c (handle_one_xevent): Ignore menu bar events which land on the menu bar itself instead of a button. --- diff --git a/src/xterm.c b/src/xterm.c index 2656b30472d..520de5fcf0f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11112,12 +11112,26 @@ handle_one_xevent (struct x_display_info *dpyinfo, && event->xbutton.y < FRAME_MENUBAR_HEIGHT (f) && event->xbutton.same_screen) { - if (!f->output_data.x->saved_menu_event) - f->output_data.x->saved_menu_event = xmalloc (sizeof *event); - *f->output_data.x->saved_menu_event = *event; - inev.ie.kind = MENU_BAR_ACTIVATE_EVENT; - XSETFRAME (inev.ie.frame_or_window, f); - *finish = X_EVENT_DROP; +#ifdef USE_MOTIF + unsigned char column_type; + Widget widget; + + widget = XtWindowToWidget (dpyinfo->display, + event->xbutton.window); + XtVaGetValues (widget, XmNrowColumnType, &column_type, NULL); + + if (column_type != XmMENU_BAR) + { +#endif + if (!f->output_data.x->saved_menu_event) + f->output_data.x->saved_menu_event = xmalloc (sizeof *event); + *f->output_data.x->saved_menu_event = *event; + inev.ie.kind = MENU_BAR_ACTIVATE_EVENT; + XSETFRAME (inev.ie.frame_or_window, f); + *finish = X_EVENT_DROP; +#ifdef USE_MOTIF + } +#endif } else goto OTHER;